
angular.module('myApp')
.controller('TransferCtrl', ['$scope', function($scope) {
  const generateData = _ => {
    const data = [];
    const cities = ['上海', '北京', '广州', '深圳', '南京', '西安', '成都'];
    const pinyin = ['shanghai', 'beijing', 'guangzhou', 'shenzhen', 'nanjing', 'xian', 'chengdu'];
    cities.forEach((city, index) => {
      data.push({
        label: city,
        key: index,
        pinyin: pinyin[index]
      });
    });
    return data;
  }
  $scope.value = [];
  $scope.data = generateData()
}])
.directive('elTransfer', elTransfer);